package com.zjbd.douyangsystem.controller;

import com.github.houbb.sensitive.word.bs.SensitiveWordBs;
import com.zjbd.douyangcommoncore.result.Result;
import com.zjbd.douyangcommoncore.vo.UploadVideoVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Tag(name = "短视频接口")
@RestController
@RequestMapping("/douyang/system/video")
public class VideoController {

    private final SensitiveWordBs sensitiveWordBs = SensitiveWordBs.newInstance().init();

    @Operation(summary = "添加短视频")
    @PostMapping("/uploadVideo")
    public Result uploadVideo(@Valid @RequestBody UploadVideoVo uploadVideoVo){
        //使用默认词库替换敏感词为*号
        String replaceTitle = sensitiveWordBs.replace(uploadVideoVo.getTitle());
        log.info("过滤后的标题{}",replaceTitle);

        return Result.success();
    }

}